<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ng/directive/input.js?message=docs(input[checkbox])%3A%20describe%20your%20change...#L905' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.3.13/src/ng/directive/input.js#L905' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">input[checkbox]</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - input in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>HTML checkbox.</p>

</div>




<div>
  

  
  <h2>Directive Info</h2>
  <ul>
    
    <li>This directive executes at priority level 0.</li>
  </ul>

  
  <h2>Usage</h2>
  <pre><code>&lt;input type=&quot;checkbox&quot;&#10;       ng-model=&quot;&quot;&#10;       [name=&quot;&quot;]&#10;       [ng-true-value=&quot;&quot;]&#10;       [ng-false-value=&quot;&quot;]&#10;       [ng-change=&quot;&quot;]&gt;</code></pre>

<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        ngModel
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Assignable angular expression to data-bind to.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        name
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Property name of the form under which the control is published.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        ngTrueValue
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-expression">expression</a>
      </td>
      <td>
        <p>The value to which the expression should be set when selected.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        ngFalseValue
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-expression">expression</a>
      </td>
      <td>
        <p>The value to which the expression should be set when not selected.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        ngChange
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Angular expression to be executed when input changes due to user
   interaction with the input element.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
  


  
  <h2 id="example">Example</h2><p>

<div>
  <a ng-click="openPlunkr('examples/example-checkbox-input-directive', $event)" class="btn pull-right">
    <i class="glyphicon glyphicon-edit">&nbsp;</i>
    Edit in Plunker</a>

  <div class="runnable-example"
      path="examples/example-checkbox-input-directive"
      name="checkbox-input-directive"
      module="checkboxExample">

  
    <div class="runnable-example-file" 
      name="index.html"
      language="html"
      type="html">
      <pre><code>&lt;script&gt;&#10;  angular.module(&#39;checkboxExample&#39;, [])&#10;    .controller(&#39;ExampleController&#39;, [&#39;$scope&#39;, function($scope) {&#10;      $scope.checkboxModel = {&#10;       value1 : true,&#10;       value2 : &#39;YES&#39;&#10;     };&#10;    }]);&#10;&lt;/script&gt;&#10;&lt;form name=&quot;myForm&quot; ng-controller=&quot;ExampleController&quot;&gt;&#10;  Value1: &lt;input type=&quot;checkbox&quot; ng-model=&quot;checkboxModel.value1&quot;&gt; &lt;br/&gt;&#10;  Value2: &lt;input type=&quot;checkbox&quot; ng-model=&quot;checkboxModel.value2&quot;&#10;                 ng-true-value=&quot;&#39;YES&#39;&quot; ng-false-value=&quot;&#39;NO&#39;&quot;&gt; &lt;br/&gt;&#10;  &lt;tt&gt;value1 = {{checkboxModel.value1}}&lt;/tt&gt;&lt;br/&gt;&#10;  &lt;tt&gt;value2 = {{checkboxModel.value2}}&lt;/tt&gt;&lt;br/&gt;&#10; &lt;/form&gt;</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="protractor.js"
      type="protractor"
      language="js">
      <pre><code>it(&#39;should change state&#39;, function() {&#10;  var value1 = element(by.binding(&#39;checkboxModel.value1&#39;));&#10;  var value2 = element(by.binding(&#39;checkboxModel.value2&#39;));&#10;&#10;  expect(value1.getText()).toContain(&#39;true&#39;);&#10;  expect(value2.getText()).toContain(&#39;YES&#39;);&#10;&#10;  element(by.model(&#39;checkboxModel.value1&#39;)).click();&#10;  element(by.model(&#39;checkboxModel.value2&#39;)).click();&#10;&#10;  expect(value1.getText()).toContain(&#39;false&#39;);&#10;  expect(value2.getText()).toContain(&#39;NO&#39;);&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-checkbox-input-directive/index.html" name="example-checkbox-input-directive"></iframe>
  </div>
</div>


</p>

</div>


